package com.liziba.unsafe.clone;

import com.liziba.unsafe.UnsafeFactory;
import com.liziba.unsafe.pojo.SimpleInfo;
import com.liziba.unsafe.pojo.User;
import sun.misc.Unsafe;

/**
 * <p>
 *      浅克隆测试
 * </p>
 *
 * @Author: Liziba
 * @Date: 2021/5/24 23:11
 */
public class ShallowCloneTest {


    public static void main(String[] args){

        SimpleInfo simpleInfo = new SimpleInfo();
        simpleInfo.setId(1);
        System.out.println(simpleInfo.hashCode());
        SimpleInfo clone = ShallowCloneUtil.shallowClone(simpleInfo);
        System.out.println(clone.hashCode());

    }

}
